//go:build embed

package fs

import (
	"embed"
	"fmt"
	"io/fs"
)

//go:embed pages/*
var _fs embed.FS

type myfs struct {
}

var FS *myfs

func (f *myfs) Open(name string) (fs.File, error) {
	if name != "" && name[0:1] == "/" {
		name = name[1:]
	}
	name = fmt.Sprintf("pages/%s", name)
	return _fs.Open(name)
}

func (f *myfs) ReadDir(name string) ([]fs.DirEntry, error) {
	return nil, nil
}
func (f *myfs) ReadFile(name string) ([]byte, error) {
	return _fs.ReadFile(fmt.Sprintf("pages/%s", name))
}
